
public class House {

	private String skeleton;
	private String wall;
	private String roof;
	
	private House() {
		
	}
	
	private void setSkeleton(String skeleton) {
		this.skeleton  = skeleton;
	}
	
	private void setWall(String wall) {
		this.wall = wall;
	}
	
	private void setRoof(String roof) {
		this.roof = roof;
	}
	
	@Override
	public String toString() {
		return "House[" + 
				"skeleton=" + skeleton + 
				", wall=" + wall +
				", roof=" + roof +
				"]";
	}
	
	//Builder 静态内部类
	public static class Builder {
		private House house = new House();
		
		public Builder buildSkeleton(String skeleton) {
			house.setSkeleton(skeleton);
			return this;
		}
		public Builder buildWall(String wall) {
			house.setWall(wall);
			return this;
		}
		public Builder buildRoof(String roof) {
			house.setRoof(roof);
			return this;
		}
		public House create() {
			return house;
		}
	}

}
